<?xml version="1.0" encoding="UTF-8"?>
<html filename="docs/SAXHelpers/TNamespaceContext.html">
<body>
<a id="#top"/>
<h1>
	                Class Summary : TNamespaceContext </h1> Internal class for a single Namespace context.

 <p>This module caches and reuses Namespace contexts,
 so the number allocated
 will be equal to the element depth of the document, not to the total
 number of elements (i.e. 5-10 rather than tens of thousands).
 Also, data structures used to represent contexts are shared when
 possible (child contexts without declarations) to further reduce
 the amount of memory that's consumed.
 </p>
<h2>
	              Methods
	            </h2>
<div style="padding-left:10px">
<a href="#copyTables">
	                  procedure
	                 copyTables()</a>
<br/>
<a href="#getDefaultNS">
	                  function
	                 getDefaultNS() : PSAXChar</a>
<br/>
<a href="#getPrefixTable">
	                  function
	                 getPrefixTable() : SAXStringArray</a>
<br/>
<a href="#getPrefixTableElements">
	                  function
	                 getPrefixTableElements() : SAXStringArray</a>
<br/>
<a href="#getPrefixTableLength">
	                  function
	                 getPrefixTableLength() : Integer</a>
<br/>
<a href="#getUriTable">
	                  function
	                 getUriTable() : SAXStringArray</a>
<br/>
<a href="#getUriTableElements">
	                  function
	                 getUriTableElements() : SAXStringArray</a>
<br/>
<a href="#getUriTableLength">
	                  function
	                 getUriTableLength() : Integer</a>
<br/>
<a href="#getDeclarations">
	                  function
	                 getDeclarations() : SAXStringArray</a>
<br/>
<a href="#setParent">
	                  procedure
	                 setParent(TNamespaceContext)</a>
<br/>
<a href="#clear">
	                  procedure
	                 clear()</a>
<br/>
<a href="#declarePrefix">
	                  procedure
	                 declarePrefix(SAXString, SAXString)</a>
<br/>
<a href="#declarePrefix">
	                  procedure
	                 declarePrefix(PSAXChar, Integer, PSAXChar, Integer)</a>
<br/>
<a href="#processName">
	                  function
	                 processName(SAXString, Boolean) : TNamespaceParts</a>
<br/>
<a href="#processName">
	                  function
	                 processName(PSAXChar, Integer, Boolean) : TNamespaceParts</a>
<br/>
<a href="#getURI">
	                  function
	                 getURI(SAXString) : SAXString</a>
<br/>
<a href="#getURI">
	                  function
	                 getURI(PSAXChar, Integer) : PSAXChar</a>
<br/>
<a href="#getPrefix">
	                  function
	                 getPrefix(SAXString) : SAXString</a>
<br/>
<a href="#getPrefix">
	                  function
	                 getPrefix(PSAXChar, Integer) : PSAXChar</a>
<br/>
<a href="#getDeclaredPrefixes">
	                  function
	                 getDeclaredPrefixes() : SAXStringArray</a>
<br/>
<a href="#getPrefixes">
	                  function
	                 getPrefixes() : SAXStringArray</a>
<br/>
</div>
<br/>
<h2>
	                Properties
	              </h2>
<div style="padding-left:10px"/>
<br/>
<hr width="100%"/>
<a name="#copyTables">
<p>
<b>procedure</b> copyTables(); </p>
</a> Copy on write for the internal tables in this context.

 <p>This class is optimized for the normal case where most
 elements do not contain Namespace declarations.</p>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getDefaultNS">
<p>
<b>function</b> getDefaultNS() : PSAXChar; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getPrefixTable">
<p>
<b>function</b> getPrefixTable() : SAXStringArray; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getPrefixTableElements">
<p>
<b>function</b> getPrefixTableElements() : SAXStringArray; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getPrefixTableLength">
<p>
<b>function</b> getPrefixTableLength() : Integer; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getUriTable">
<p>
<b>function</b> getUriTable() : SAXStringArray; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getUriTableElements">
<p>
<b>function</b> getUriTableElements() : SAXStringArray; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getUriTableLength">
<p>
<b>function</b> getUriTableLength() : Integer; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getDeclarations">
<p>
<b>function</b> getDeclarations() : SAXStringArray; </p>
</a><br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setParent">
<p>
<b>procedure</b> setParent(<b>const</b> parent : TNamespaceContext); </p>
</a> (Re)set the parent of this Namespace context.
 The context must either have been freshly constructed,
 or must have been cleared

<br/><b>Parameter : </b> context The parent Namespace context object.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#clear">
<p>
<b>procedure</b> clear(); </p>
</a> Makes associated state become collectible,
 invalidating this context.
 <a href="../SAXHelpers/TNamespaceSupport.html#setParent">setParent</a> must be called before
 this context may be used again.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#declarePrefix">
<p>
<b>procedure</b> declarePrefix(<b>const</b> prefix : SAXString; <b>const</b> uri : SAXString); </p>
</a> Declare a Namespace prefix for this context.

<br/><b>Parameter : </b> prefix The prefix to declare.
<br/><b>Parameter : </b> uri The associated Namespace URI.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#declarePrefix">TNamespaceSupport.declarePrefix</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#declarePrefix">
<p>
<b>procedure</b> declarePrefix( prefix : PSAXChar;  prefixLength : Integer;  uri : PSAXChar;  uriLength : Integer); </p>
</a> Declare a Namespace prefix for this context.

<br/><b>Parameter : </b> prefix The prefix to declare.
<br/><b>Parameter : </b> prefixLength The length of the prefix buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Parameter : </b> uri The associated Namespace URI.
<br/><b>Parameter : </b> uriLength The length of the uri buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#declarePrefix">TNamespaceSupport.declarePrefix</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#processName">
<p>
<b>function</b> processName(<b>const</b> qName : SAXString;  isAttribute : Boolean) : TNamespaceParts; </p>
</a> Process a raw XML 1.0 name in this context.

<br/><b>Parameter : </b> qName The raw XML 1.0 name.
<br/><b>Parameter : </b> isAttribute true if this is an attribute name.
<br/><b>Result : </b> An array of three strings containing the
         URI part (or empty string), the local part,
         and the raw name, all internalized, or empty
         if there is an undeclared prefix.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#processName">TNamespaceSupport.processName</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#processName">
<p>
<b>function</b> processName( qName : PSAXChar;  qNameLength : Integer;  isAttribute : Boolean) : TNamespaceParts; </p>
</a> Process a raw XML 1.0 name in this context.

<br/><b>Parameter : </b> qName The raw XML 1.0 name.
<br/><b>Parameter : </b> qNameLength The length of the qName buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Parameter : </b> isAttribute true if this is an attribute name.
<br/><b>Result : </b> An array of three PSAXChars (null terminated) containing the
         URI part (or empty string), the local part,
         and the raw name, all internalized, or empty
         if there is an undeclared prefix.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#processName">TNamespaceSupport.processName</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getURI">
<p>
<b>function</b> getURI(<b>const</b> prefix : SAXString) : SAXString; </p>
</a> Look up the URI associated with a prefix in this context.

<br/><b>Parameter : </b> prefix The prefix to look up.
<br/><b>Result : </b> The associated Namespace URI, or empty if none is
         declared.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#getURI">TNamespaceSupport.getURI</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getURI">
<p>
<b>function</b> getURI( prefix : PSAXChar;  prefixLength : Integer) : PSAXChar; </p>
</a> Look up the URI associated with a prefix in this context.

<br/><b>Parameter : </b> prefix The prefix to look up.
<br/><b>Parameter : </b> prefixLength The length of the prefix buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Result : </b> The associated Namespace URI, or empty if none is
         declared.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#getURI">TNamespaceSupport.getURI</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getPrefix">
<p>
<b>function</b> getPrefix(<b>const</b> uri : SAXString) : SAXString; </p>
</a> Look up one of the prefixes associated with a URI in this context.

 <p>Since many prefixes may be mapped to the same URI,
 the return value may be unreliable.</p>

<br/><b>Parameter : </b> uri The URI to look up.
<br/><b>Result : </b> The associated prefix, or empty if none is declared.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#getPrefix">TNamespaceSupport.getPrefix</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getPrefix">
<p>
<b>function</b> getPrefix( uri : PSAXChar;  uriLength : Integer) : PSAXChar; </p>
</a> Look up one of the prefixes associated with a URI in this context.

 <p>Since many prefixes may be mapped to the same URI,
 the return value may be unreliable.</p>

<br/><b>Parameter : </b> uri The URI to look up.
<br/><b>Parameter : </b> uriLength The length of the URI buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Result : </b> The associated prefix, or empty if none is declared.
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#getPrefix">TNamespaceSupport.getPrefix</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getDeclaredPrefixes">
<p>
<b>function</b> getDeclaredPrefixes() : SAXStringArray; </p>
</a> Return an enumeration of prefixes declared in this context.

<br/><b>Result : </b> An enumeration of prefixes (possibly empty).
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#getDeclaredPrefixes">TNamespaceSupport.getDeclaredPrefixes</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getPrefixes">
<p>
<b>function</b> getPrefixes() : SAXStringArray; </p>
</a> Return an enumeration of all prefixes currently in force.

 <p>The default prefix, if in force, is <em>not</em>
 returned, and will have to be checked for separately.</p>

<br/><b>Result : </b> An enumeration of prefixes (never empty).
<br/><b>See : </b> <a href="../SAXHelpers/TNamespaceSupport.html#getPrefixes">TNamespaceSupport.getPrefixes</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<div style="padding-left:10px">
<hr width="100%"/>
<a name="#prefixTable">
<p> <b>prefixTable</b>
</p>
</a> Extension properties to get properties from self or parent
<br/>
<p style="margin-left:30px">
<code>property prefixTable : SAXStringArray read getPrefixTable</code>
</p>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#prefixTableElements">
<p> <b>prefixTableElements</b>
</p>
</a><br/>
<p style="margin-left:30px">
<code>property prefixTableElements : SAXStringArray read getPrefixTableElements</code>
</p>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#prefixTableLength">
<p> <b>prefixTableLength</b>
</p>
</a><br/>
<p style="margin-left:30px">
<code>property prefixTableLength : Integer read getPrefixTableLength</code>
</p>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#uriTable">
<p> <b>uriTable</b>
</p>
</a><br/>
<p style="margin-left:30px">
<code>property uriTable : SAXStringArray read getUriTable</code>
</p>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#uriTableElements">
<p> <b>uriTableElements</b>
</p>
</a><br/>
<p style="margin-left:30px">
<code>property uriTableElements : SAXStringArray read getUriTableElements</code>
</p>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#uriTableLength">
<p> <b>uriTableLength</b>
</p>
</a><br/>
<p style="margin-left:30px">
<code>property uriTableLength : Integer read getUriTableLength</code>
</p>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#defaultNS">
<p> <b>defaultNS</b>
</p>
</a><br/>
<p style="margin-left:30px">
<code>property defaultNS : PSAXChar read getDefaultNS</code>
</p>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#declarations">
<p> <b>declarations</b>
</p>
</a><br/>
<p style="margin-left:30px">
<code>property declarations : SAXStringArray read getDeclarations</code>
</p>
<p>
<a href="#top">Top</a>
</p>
</div>
<br/>
</body>
</html>